package com.gzhryc.shared_device.oem.h5.agent.mng;

import javax.servlet.http.HttpServletRequest;

import com.gzhryc.common.config.PropertyTools;
import com.gzhryc.common.logging.Logger;

public class WebConstants {

	static Logger log = Logger.getLogger(WebConstants.class);
	
	public final static String PROGRAM_TYPE = "h5_agent_mng";
	public final static String PROGRAM_TYPE_NAME = "代理后台管理";
	
	public final static String CONF_RES_DOMAIN_KEY = "resDomain";

	public final static Integer PAGE_LIMIT = 20;

	public final static String SESSION_LOGIN_AGENT = "_session_login_agent";
	public final static String LOGIN_USER = "loginUser";

	public final static String SESSION_BXSCN_BT_DM_CONTENT = "_bxscn_bt_dm_content";

	public static boolean isDebug() {
		return PropertyTools.get().getBoolean("isDebug", false);
	}
	
	/**
	 * 获取资源域名
	 * @param request
	 * @return
	 */
	public static String getResDomain(HttpServletRequest request) {
		//检查是否使用本地资源
		boolean localRes = PropertyTools.get().getBoolean("localRes",false);
        if(localRes) {
        	return "/agent_mng";
        }else {
        	return PropertyTools.get().getString(CONF_RES_DOMAIN_KEY);
        }
	}
}
